import sys
import not_so_free_marker


# 使用方式: main.py 项目名 数据文件地址

def main():
    json_file = "test_data\\11111.json"
    template_file = "test_data\\11111.html"
    result_file = "test_data\\11111.vm.html"
    if len(sys.argv) > 3:
        template_file = sys.argv[1]
        json_file = sys.argv[2]
        result_file = sys.argv[3]
    generated = not_so_free_marker.process_file(template_file, json_file)
    not_so_free_marker.file_helper.write_file(result_file, generated)


if __name__ == "__main__":
    main()
